<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <style type="text/css">
        body {
            background: url(背景7.jpg) no-repeat center center fixed;
            background-size: cover;
            min-height: 100vh;
            box-sizing: border-box;
            margin: 0;
            padding-top: calc(50vh - 6em);
            font: 150%/1.5 Baskerville, Palatino, serif;
        }

        .description{
            position: relative;
            margin: 0 auto;
            padding: 1em;
            max-width: 23em;
            background: hsla(0,0%,100%,.25) border-box;
            overflow: hidden;
            border-radius: .3em;
            box-shadow: 0 0 0 1px hsla(0,0%,100%,.3) inset,
            0 .5em 1em rgba(0, 0, 0, 0.6);
            text-shadow: 0 1px 1px hsla(0,0%,100%,.3);
        }

        .description::before{
            content: '';
            position: absolute;
            top: 0; right: 0; bottom: 0; left: 0;
            margin: -30px;
            z-index: -1;
            -webkit-filter: blur(20px);
            filter: blur(20px);
        }
    </style>

    <script language="javascript">
        /* 函数定义 */
        function check() {
            if (tid.id.value == "") {
                window.alert("id不能为空!");
            }
            else if (tid.name.value == "") {
                window.alert("名称不能为空!");
            }
            else if (tid.wholesaler.value == "") {
                window.alert("批发商不能为空!");
            }
            else if (tid.price.value == "") {
                window.alert("单价不能为空!");
            }
            else if (tid.number.value == "") {
                window.alert("数量不能为空!");
            }
            else {
                tid.action="<%=request.getContextPath()%>MainInterface";
                tid.submit();
            }
        }
        /* 函数调用 */
    </script>
</head>
<center>
<body>
<h2>添加商品</h2>
<form method="post" id="tid">
<p class="description">
<table>
    <tr>
        <td>id</td>
        <td><input type="text" name="id"/></td>
    </tr>
    <tr>
        <td>名称</td>
        <td><input type="text" name="name"/></td>
    </tr>
    <tr>
        <td>批发商</td>
        <td><input type="text" name="wholesaler"/></td>
    </tr>
    <tr>
        <td>单价</td>
        <td><input type="text" name="price"/></td>
    </tr>
    <tr>
        <td>数量</td>
        <td><input type="text" name="number"/></td>
    </tr>

</table>
    <table>
        <tr>
            <td><input type="submit" value="提交" onclick="check()"/></td>
            <td><input type="reset" value="重置"/></td>
        </tr>
    </table>
</p>
</form>
</body>
</center>
</html>
